<?php
/** 自定义过滤器
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/6
 * Time: 14:49
 */
function convertSpace($string)
{
    return str_replace("_", ".", $string);
}

$string = "www_runoob_com!";

echo filter_var($string, FILTER_CALLBACK,
    array("options"=>"convertSpace"));
?>